//package com.xiao.user.controller;
//
//import com.xiao.user.model.User;
//import com.xiao.user.model.dto.UserDto;
//import com.xiao.user.service.criteria.UserCriteria;
//import com.xiao.user.service.user.UserService;
//import com.xiao.user.web.util.PaginationUtil;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.data.domain.Pageable;
//import org.springframework.http.HttpHeaders;
//import org.springframework.http.ResponseEntity;
//import org.springframework.validation.annotation.Validated;
//import org.springframework.web.bind.annotation.*;
//
//import java.net.URISyntaxException;
//import java.util.List;
//
//@RestController
//@RequestMapping("user")
//@Slf4j
////@Api(value = "角色", tags = "角色")
//public class RoleController extends AbstractResource<User, UserDto, Long>{
//
//    private final UserService userService;
//
//    public static final String ENTITY_NAME = "Role";
//
//    public RoleController(UserService userService) {
//        super(userService, ENTITY_NAME);
//        this.userService = userService;
//    }
//
////    @ApiOperation(value = "新建")
//    @PostMapping
//    public ResponseEntity<UserDto> save(@RequestBody UserDto dto) throws URISyntaxException {
//        return createEntity(dto);
//    }
//
////    @ApiOperation(value = "根据id删除", notes = "根据id删除")
//    @DeleteMapping("{id}")
//    public ResponseEntity<Void> deleteById(@PathVariable(name = "id") Long id) {
//        return deleteEntity(id);
//    }
//
//
////    @ApiOperation(value = "更新", notes = "更新")
//    @PutMapping("{id}")
//    public ResponseEntity<UserDto> update(
//            @PathVariable("id") Long id,
//            @Validated @RequestBody UserDto dto) {
//        return updateEntity(id, dto);
//    }
//
//    @GetMapping("{id}")
////    @ApiOperation("根据ID查询")
//    public ResponseEntity<UserDto> findById(@PathVariable("id") Long id) {
//        return findEntityById(id);
//    }
//
//    @GetMapping
////    @ApiOperation("查询所有数据")
//    public ResponseEntity<List<UserDto>> findAll(UserCriteria criteria, Pageable pageable) throws InterruptedException {
//        return findAllByPage(criteria, pageable);
//    }
//
//    //    @ApiOperation("查询所有数据")
//    @GetMapping("all")
//    public ResponseEntity<List<UserDto>> findAll() {
//        final List<UserDto> UserDtoList = userService.findAll();
//        HttpHeaders headers = PaginationUtil.generateListHttpHeaders(UserDtoList);
//        return ResponseEntity.ok().headers(headers).body(UserDtoList);
//    }
//
//    @Override
//    protected Long getId(UserDto dto) {
//        return dto.getId();
//    }
//}
